package com.c.ctgproject.ui.collect

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel

class PowerBatteryInWarehouseViewModel:ViewModel() {
    private val _searchMine: MutableLiveData<Boolean> = MutableLiveData()
    val searchMine: LiveData<Boolean>
        get() = _searchMine
    private val _carIdList: MutableLiveData<List<Int>> = MutableLiveData()
    val carIdList: LiveData<List<Int>>
        get() = _carIdList

    init {
        _carIdList.value= ArrayList()
        _searchMine.value?:false
    }
    fun changeSearchMine(data:Boolean){
        _searchMine.value=data
    }
    fun addCarId(id:Int){
        _carIdList.value=_carIdList.value?.plus(id)
    }
    fun removeCarId(id:Int){

        _carIdList.value=_carIdList.value?.minus(id)
    }
    fun clear(){
        _carIdList.value= emptyList()
    }
}